package com.youwu.weather.service.impl;

import com.youwu.weather.service.WeatherReportService;
import com.youwu.weather.vo.Basic;
import com.youwu.weather.vo.HeWeather6;
import com.youwu.weather.vo.Now;
import com.youwu.weather.vo.WeatherType;
import org.springframework.stereotype.Service;

import java.util.*;

@Service
public class WeatherReportServiceImpl implements WeatherReportService {

    @Override
    public List<HeWeather6> getDataByCity(WeatherType weatherType, String city) {
        // TODO 数据来源：天气数据api微服务提供
        // 暂时数据写死
        List<HeWeather6> list = new ArrayList<>();
        HeWeather6 heWeather6 = new HeWeather6();
        Basic basic = new Basic();
        basic.setCid("1");
        basic.setLocation("厦门");
        basic.setCnty("厦门");
        basic.setParent_city("厦门");
        heWeather6.setBasic(basic);
        Map<String, Object> update = new HashMap<>();
        update.put("updateTime", new Date());
        heWeather6.setUpdate(update);
        heWeather6.setStatus("ok");
        Now now = new Now();
        now.setTmp("22");
        now.setCloud("3级");
        heWeather6.setNow(now);
        list.add(heWeather6);
        return list;
    }
}
